<template>
  <div class="home">
    <div>Vuex-action基本操作</div>
    <div>{{$store.state.length}}</div>
    <button @click='handleClick'>查询</button>
  </div>
</template>

<script>
export default {
  data () {
    return {
      count: 10
    }
  },
  methods: {
    handleClick () {
      // 调用接口获取数据：触发action
      this.$store.dispatch('queryData', 123)
    }
  }
}
</script>
